package rpcclient

import "cloud_worm/util/proto/urpc"

// 推送的通用消息，用于向上的采集推送处理
type PushMsg struct {
	AgentId 		string
	AgentIP 		string
	TimeStamp 		string
	PayLoad 		[]byte

	NeedAgain		bool

	tryCount 		int
}

func (w *PushMsg) GetTryCount() int {
	return w.tryCount
}

func (w *PushMsg) AddTryCount()  {
	w.tryCount++
	return
}

func (w *PushMsg) GetMethodName() string {
	return "PushMsg.MsgPost"
}

func (w *PushMsg) GetArgs() interface{} {
	return &urpc.PushMsgArgs{
		AgentId: w.AgentId,
		AgentIP: w.AgentIP,
		TimeStamp: w.TimeStamp,
		PayLoad: w.PayLoad,
	}
}

func (w *PushMsg) GetReply() interface{} {
	return &urpc.PushMsgReply{}
}

func (w *PushMsg) IsNeedAgain() bool {
	return w.NeedAgain
}
